import {ref} from 'vue';
export default class HomeView{
    constructor(){
    }
    private toastData = ref({msg:''});
    private isShow = ref(false);
    public clickMe=()=>{
        let obj={
            msg:'点击了我'
        }
        this.showMessage(obj);
    }
    public clickYou=()=>{
        let obj={
          msg:'点击了你'
        }
        this.showMessage(obj);
    }
    private showMessage=(messageObj)=>{
        this.isShow.value=true;
        this.toastData.value=messageObj;
        setTimeout(()=>{
            this.isShow.value=false;
        },1000);
    }
    public init(){
       return {
        toastData:this.toastData,
        isShow:this.isShow
       }
    }
}